home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / XCMD libraries 960603 / doXCMDPlusPlus.c next >
C/C++ Source or Header  |  1995-11-19  |  1KB  |  34 lines

  1. #include <A4Stuff.h>
  2.  
  3. #include    "doXCMDPlusPlus.h"
  4.  
  5. //•••••••    Metrowerks sez....
  6. //You must set up your main like this if you are going to use globals, strings or
  7. //inter-segment calls.  If you need to use Callbacks, please look for "68K App 68K 
  8. //Multi-Seg CR" in the 68K examples folder.
  9. //•••••••
  10.  
  11. //•••••••    What they didn't tell us or assumed we already knew...
  12. //    You must make all your declarations outide the scope of the routine which
  13. //    sets up and destroys the A4 world. If you do not and you execute a method
  14. //    after A4 world has been altered, life ends.  
  15. //        i.e. an A4 world is created, an xcmd object is instantiated, the A4
  16. //        world is reset, then the destructor is called. If it is a 
  17. //        virtual destructor (any time a virtual method is declared)
  18. //        all hell breaks loose after you return to the caller.
  19. //•••••••
  20.  
  21. pascal void main( XCmdPtr    paramPtr )
  22. {
  23.     long    oldA4 = SetCurrentA4();    // A4 must be set up for globals, strings, and 
  24.                                     // inter-segment calls 
  25.      
  26.     doXCMDPlusPlus ( paramPtr );    // <--- your code goes here
  27.     
  28.     
  29.     SetA4(oldA4);                    // reset A4 before leaving XCMD
  30. }
  31.  
  32.  
  33.  
  34.